package cn.tedu.lianxi2;

import java.util.Arrays;
import java.util.Random;

public class Text5 {
	public static void main(String[] args) {
		p();
		
	}
      
	   private static void p() {
		   int b=new Random().nextInt(10)+2;
		   System.out.println(b);
		   int[] a=new int[b];
		   for(int i=1;i<=b;i++) {
			   a[i-1]=new Random().nextInt(1000)+1;
		   }
		   for(int i=0;i<b;i++) {
			   System.out.print(a[i]+" ");
		   }
		   System.out.println();
		   System.out.println(Arrays.toString(a));
		   for(int i=0;i<b;i++) {
			   for (int j = 0; j < b; j++) {
				if (a[i]<a[j]) {
					int d=a[i];
					a[i]=a[j];
					a[j]=d;
				}
			}
		   }
		   System.out.println(Arrays.toString(a));
		  
	}

}
